// custom-tab-bar/index.js
const app = getApp();

Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    "selected": 1,
    "backgroundColor": "#ffffff",
    "color": "#cdcdcd",
    "selectedColor": "#FFBE00",
    "list": [{
      "pagePath": "/pages/statistics/statistics",
      "text": "统计",
      "iconPath": "/assets/images/tabBar/account.png",
      "selectedIconPath": "/assets/images/tabBar/account_active.png"
    }, {
      "pagePath": "/pages/bill/bill",
      "text": "账单",
      "isSpecial": true,
      "iconPath": "/assets/images/tabBar/account_list.png",
      "selectedIconPath": "/assets/images/tabBar/add.png"
    }, {
      "pagePath": "/pages/profile/profile",
      "text": "我的",
      "iconPath": "/assets/images/tabBar/profile.png",
      "selectedIconPath": "/assets/images/tabBar/profile_active.png"
    }],
    isIphoneX: app.globalData.systemInfo.model.search('iPhone X') != -1 ? true : false
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e){
      const index = e.currentTarget.dataset.index
      this.setData({
        selected: index
      })
    },
    handleClick(){
      console.log('跳转到添加页面')
      // wx.reLaunch({
      //   url: '/pages/add/add',
      // })
      wx.navigateTo({
        url: '/pages/add/add',
      })
    }
  }
})
